import Vue from "vue";
import Vuex from "vuex";
import { getItem, setItem } from "../utils/storge";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    user: getItem('USERPASE') || {}
  },
  mutations: {
    setUser(state, data) {
      state.user = data;
    setItem('USERPASE',data)
    },
  },
  actions: {},
  modules: {},
  getters:{
    token:state=>state.user.token
  }
});
